package com.wzs.rpc.fault.tolerant;

import com.wzs.rpc.model.RpcResponse;
import lombok.extern.slf4j.Slf4j;

import java.util.Map;

/**
 * 快速容错：直接将异常抛给上层调用者
 */
@Slf4j
public class FailFastTolerantStrategy implements TolerantStrategy{
    @Override
    public RpcResponse doTolerant(Map<String, Object> context, Exception e) {
        log.error("服务报错", e);
        throw new RuntimeException("服务报错", e);
    }
}
